<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .fu{
            width: 600px;
            height: 300px;
            background-color: pink;
            position: relative;
        }
        .zi{
            width: 300px;
            height: 100px;
            background-color: blue;
            position: absolute;
            left: 50%;
            top: 50%;
            /* margin-left: -100px; */
            /* transform: translateX(-50%) translateY(-50%) ; */
            transform: translate(-50%, -50%);
        }
    </style>
</head>
<body>
    <div class="fu">
        <div class="zi"></div>
    </div>
</body>
</html>